﻿using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

// 继承 VolumeComponent，使其可用于 Volume
[System.Serializable, VolumeComponentMenu("Lch/VolumneFog")]
public class LchVolumneFog : VolumeComponent, IPostProcessComponent
{
    
    public BoolParameter enable = new BoolParameter(false);

    [Header("噪点缩放1")]
    public ClampedFloatParameter _NoiseScale1 = new ClampedFloatParameter(0.342f, 0.1f, 2f);
    [Header("噪点缩放2")]
    public ClampedFloatParameter _NoiseScale2 = new ClampedFloatParameter(0.393f,  0.1f, 2f);
    [Header("噪点方向1")]
    public Vector2Parameter dir1 = new Vector2Parameter(new Vector2(-2.4f, 0.2f));
    [Header("噪点方向2")]
    public Vector2Parameter dir2 = new Vector2Parameter(new Vector2(-2.8f, 0.5f));

    public ClampedFloatParameter _Density = new ClampedFloatParameter(297f, 1f,100f);
    public ClampedFloatParameter _Near = new ClampedFloatParameter(0, 0f, 100f);

    public ColorParameter _FogColor = new ColorParameter(Color.white, true, false, false);
    //public ClampedFloatParameter _AO = new ClampedFloatParameter(0.1f, 0f, 0.5f);
    public ClampedFloatParameter _FogMax = new ClampedFloatParameter(0.882f, 0f, 1f);
 
 
    // 使用 NoInterpTextureParameter 来存储 3D 纹理
    public NoInterpTextureParameter fogNoise = new NoInterpTextureParameter(null);

    public bool IsActive() => enable.value ;

 

    public bool IsTileCompatible() => false;
}
